打开目录 /etc/sysconfig/network-scripts/ifcfg-xxxx
编辑ifcfg-xxxx 修改内容为:
HWADDR=00:0c:29:44:8e:e7
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=enp2s0
UUID=5b0a7d76-1602-4e19-aee6-29f57618ca01
ONBOOT=yes控制台输入ifconfig,结果如下
1
2
3
4
5
6
7
8
9[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.12.129.236 netmask 255.255.252.0 broadcast 10.12.131.255
inet6 fe80::20c:29ff:fedb:2094 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:db:20:94 txqueuelen 1000 (Ethernet)
RX packets 2532 bytes 947758 (925.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 804 bytes 116326 (113.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0修改步骤2中HWADDR数值与ens33中ether数值00:0c:29:db:20:94一样
5.1
service network restart